<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/business/include/doctype.jsp" %>
	<script type="text/javascript" src="${requestScope.contextPath}/js/cubiq-iscroll/iscroll.js"></script>
	<script type="text/javascript">
		var myScroll;
		function loaded() {
			myScroll = new iScroll('wrapper', { 
				checkDOMChanges: true,
				zoom: false
			});
			<c:if test="${param.endY != null and param.endY != ''}">
			myScroll.scrollTo(0, ${param.endY}, 0);
			endY = ${param.endY};
			</c:if>
		}
		document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
		window.addEventListener('DOMContentLoaded', setTimeout(function () { loaded(); }, 100), false);
	</script>
	<link rel="stylesheet" type="text/css" href="${requestScope.contextPath}/js/jquery-ui-1.8.14.custom/css/ui-lightness/jquery-ui-1.8.14.custom.css" />
	<script type="text/javascript">
		function goSearch() {
			var frm = document.boardSearch;
			frm.SearchTitle.value = document.getElementById('sTid').value;
			if(frm.SearchStartDate.value == "" && frm.SearchEndDate.value == "" && trim(frm.SearchTitle.value) == "") {
				alert("검색어를 입력하세요.");
				frm.SearchTitle.value = "";
				return false;
			}else{
				return true;
			}
			return false;
		}
		$(function() {
			var dates = $('#SearchStartDate, #SearchEndDate').datepicker({
				showOn: "button",
				buttonImage: "${requestScope.contextPath}/images/reservation/cal1.gif",
				buttonImageOnly: true,
				numberOfMonths: 1,
				dateFormat: 'yy-mm-dd',
				showMonthAfterYear:true,
				showButtonPanel: true,
				monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
				dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],
				onSelect: function(selectedDate) {
					var option = this.id == "SearchStartDate" ? "minDate" : "maxDate";
					var instance = $(this).data("datepicker");
					var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
					dates.not(this).datepicker("option", option, date);
				}
			});
		});		
	function newMore(){
		var currCnt = ${mapList2.CurrPage}*${mapList2.OnePageCnt};
		var tot = ${mapList2.TotalRecordCnt};
		if (currCnt > tot) {
			$('.more11').html('없음');
			return;
		}
		var nParm = "?strMode=3&SearchUserName=&SearchTitle=${SearchTitle}&SortAscDesc=desc&page=${Page}&SearchStartDate=${SearchStartDate}&SearchEndDate=${SearchEndDate}&endY="+endY;
		location.href='${requestScope.contextPath}/business/mKolonInt/mKolonIntSearchList.do'+nParm;
		
		}	
	</script>
	<style type="text/css" media="all">
/*원본 : #wrapper { position:absolute; z-index:1; top:132px; bottom:0px; left:0; width:320px;  overflow:auto; }*/
		#wrapper { position:absolute; z-index:1; top:132px; bottom:0px; left:0; width:100%;  overflow:auto; }
		#scroller { position:absolute;  -webkit-tap-highlight-color:rgba(0,0,0,0); width:100%; padding:0; background:#fff; }
	</style>
</head>
<body>
	<div id="wrap">
		<div class="header">
			<h1>코오롱지식인</h1>
		</div><!-- // header -->
		<div class="search_box">
      			<form name="boardSearch" method="get" action="${requestScope.contextPath}/business/mKolonInt/mKolonIntSearchList.do" onsubmit="return goSearch();">
      				<input type="hidden" name="strMode" value="3" />      				
      				<input type="hidden" name="CompanyCode" value="${CompanyCode}" />
      				<input type="hidden" name="SearchUserName" value="" />
      				<input type="hidden" name="SortFieldName" value="${SortFieldName}" />
      				<input type="hidden" name="SortAscDesc" value="desc" />
					<input type="hidden" name="SearchTitle" />
      				
      				<table summary="" cellspacing="0" class="table3">
					<caption>코오롱지식인검색</caption>
					<colgroup>
						<col width="15%" />
						<col width="85%" />
					</colgroup>
					<tbody>
						<tr>
							<th scope="row"><label for="title">제목</label></th>
							<td><input type="text" id="sTid" value="${SearchTitle}" /> <input type="image" src="${requestScope.contextPath}/images/btn/btn_search2.gif" alt="게시물 제목 검색" /></td>
						</tr>
						<tr>
							<th scope="row"><label for="date">날짜</label></th>
							<td><input type="text" name="SearchStartDate"  value="${SearchStartDate}" id="SearchStartDate" readonly="readonly" size="10" />~<input type="text" name="SearchEndDate" title="날짜검색" value="${SearchEndDate }" id="SearchEndDate" readonly="readonly" size="10" /></td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
		<div id="wrapper" class="content">
			<div id="scroller">
				<div class="news knowledge">
					<ul id="news">
					<c:choose>
					<c:when test="${empty mapList}">
						<li>일치하는 자료가 없습니다.</li>
					</c:when>
					<c:otherwise>
					<c:forEach items="${mapList}" var="mapInfo" varStatus="status">
						<li>
						<c:choose>
	       					<c:when test="${mapInfo.Ref_Level == 1}">
								<a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntView.do?ArticleCD=${mapInfo.ArticleCD}&schTp=Y"><span class="bold list1">${mapInfo.Title}</span><span class="date1" style="letter-spacing:-1px; ">${mapInfo.UserName} | ${mapInfo.UCreateDate} | 조회 : ${mapInfo.ViewCnt} | 추천 : ${mapInfo.Point}</span></a><span class="ripple_bg"><a href="/business/mKolonInt/mKolonIntComent.do?ArticleCD=${mapInfo.ArticleCD}">댓글:${mapInfo.CommentCNT }</a></span>
							</c:when>
							<c:otherwise>
								<ul class="int_ripple">
									<li>
										<a href="${requestScope.contextPath}/business/mKolonInt/mKolonIntView.do?ArticleCD=${mapInfo.ArticleCD}&schTp=Y"><span class="bold list2">${mapInfo.Title}</span><span class="date1" >${mapInfo.UserName} | ${mapInfo.UCreateDate} | 조회 : ${mapInfo.ViewCnt} | 추천 : ${mapInfo.Point}</span></a><span class="ripple_bg1"><a href="/business/mKolonInt/mKolonIntComent.do?ArticleCD=${mapInfo.ArticleCD}">댓글:${mapInfo.CommentCNT }</a></span>
									</li>
								</ul>
							</c:otherwise>
						</c:choose>
						</li>
					</c:forEach>
					</c:otherwise>
					</c:choose>
					</ul>
					<c:if test="${mapList2.TotalRecordCnt > fn:length(mapList)}">
					<div class="btn_more11">
						<p class="more11"><a href="javascript:newMore();">15개 더보기</a></p>
						<p class="more22"><a href="javascript:myScroll.scrollTo(0, 0, 0);"><img src="${requestScope.contextPath}/images/news/btn_top.gif" alt="맨위로" />&nbsp;&nbsp;맨위로</a></p>
					</div>
					</c:if>
				</div>
			</div><!-- // content -->
		</div>
	</div><!-- // wrap -->
</body>
</html>